with open("data.txt","r") as fp:
    rows = fp.readlines()
data = []
for each_row in rows:
    data.append(eval(each_row))
data.sort()

data_str = [str(i)+'\n'for i in data]

with open ('E:\\\data_asc.txt','w') as f:
           f.writelines(data_str)
